package fun.eliauk.treedemo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import fun.eliauk.treedemo.config.mybatisplus.EncryptTypeHandler;
import fun.eliauk.treedemo.utils.mask.FieldMask;
import fun.eliauk.treedemo.utils.mask.enums.MaskEnum;
import lombok.Data;

import java.io.Serializable;

@Data
@TableName(autoResultMap = true)
public class User implements Serializable {

    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    private String name;

    @FieldMask(MaskEnum.MOBILE_PHONE)
    @TableField(typeHandler = EncryptTypeHandler.class)
    private String phone;

    @FieldMask(MaskEnum.ID_CARD)
    @TableField(typeHandler = EncryptTypeHandler.class)
    private String idCard;

    @FieldMask(MaskEnum.BANK_CARD)
    @TableField(typeHandler = EncryptTypeHandler.class)
    private String bankCard;


    @TableField(typeHandler = EncryptTypeHandler.class)
    @FieldMask(MaskEnum.ADDRESS)
    private String address;
}